package com.design.controller.web;


import com.design.model.*;
import com.design.service.ShippingRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@Api(tags = "【WEB端-偏载信息】")
@RequestMapping("/shippingRecord")
@CrossOrigin(origins = "*")
public class ShippingRecordController {
    @Autowired
    private ShippingRecordService service;



    @ApiOperation(value = "偏载信息-偏载列表")
    @GetMapping("/queryUserRecords")
    public PageResult<UserRecordResponse> queryUserRecords(@RequestParam("userId") Long userId,
                                                           @RequestParam("status")Integer status,
                                                           @RequestParam("batchId")Integer batchId,
                                                           @RequestParam("pageNum")Integer pageNum,
                                                           @RequestParam("pageSize")Integer pageSize) {
        return service.queryUserRecords(userId, status,batchId, pageNum, pageSize);
    }


    @ApiOperation(value = "偏载信息-删除记录")
    @PostMapping("/remove")
    public BaseResult<Void> deleteRecord(@RequestBody Map<String,Integer> map) {
        service.deleteRecord(map.get("id"));
        return new BaseResult<>();
    }



}
